#include "error.h"
#include "eeprom.h"

uint32_t error_type = 0;

void app_fault_handle(uint8_t error)
{
    eeprom_data_t eeprom_data;
 
    error_type = error;
 
    eeprom_erase(1, EEPROM_ERROR_TYPE_ADDR);
 
    eeprom_data.len = 1;
    eeprom_data.address = EEPROM_ERROR_TYPE_ADDR;
    eeprom_data.eeprom_data = &error_type;
 
    eeprom_write(eeprom_data);
 
    NVIC_SystemReset();
}


